Skip to main content

Import

Usage

Parameters

The hook accepts an optional configuration object with the following properties:

Return Type: UseFeeOptionsReturnType

The hook returns a tuple with the following elements:

Properties

pendingFeeOptionConfirmation

FeeOptionConfirmation | undefined Object containing the current fee confirmation details if a transaction is pending, or undefined if no transaction is pending confirmation.
When skipFeeBalanceCheck is false, the options will be of type FeeOptionExtended, which includes balance information:

confirmPendingFeeOption

(id: string, feeTokenAddress: string) => void Function to confirm the selected fee option.

rejectPendingFeeOption

(id: string) => void Function to reject the current fee option selection.

Notes

This hook provides functionality for handling Sequence V3 fee options for unsponsored transactions. Key features:
  • Intercept fee options for a transaction in Native Token and ERC20 tokens
  • Automatically fetch user wallet balances for each fee option (unless skipFeeBalanceCheck is true)
  • Allow users to select their preferred fee token through a UI component
  • Confirm or reject fee selections
  • Shared state management across multiple hook instances
The hook integrates with the Sequence V3 connector to intercept fee confirmation requests and presents a user interface to allow selection of the fee token. It uses shared state management to ensure consistent behavior across multiple instances of the hook. For a detailed guide on how to use the hook, see the Pay gas in ERC20 guide.